﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Modeling_Sub_Pages_NewsPage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        UniversityDatabaseManagerment udm = new UniversityDatabaseManagerment();

        try
        {
            lblStatus.Text = "";
            lblError.Text = "";

            int id = Convert.ToInt32(txtID.Text);

            string status = udm.getStatusAddmissionByID(udm.createConnection(), id);

            if (status != null)
            {
                if (status.Equals("Checking"))
                {
                    lblStatus.ForeColor = System.Drawing.Color.Blue;
                }
                else if (status.Equals("Accept"))
                {
                    lblStatus.ForeColor = System.Drawing.Color.Green;
                }
                else if (status.Equals("Reject"))
                {
                    lblStatus.ForeColor = System.Drawing.Color.Red;
                }

                lblStatus.Text = status;
            }
            else {
                lblError.Text = "This Addmission's code is not exist!";
            }
        }
        catch (Exception)
        {
            Response.Redirect("~/ErrorPage.aspx");
        }
    }
}